#ifndef SKILL_H
#define SKILL_H



#include "Item.h"
#include "Attribute.h"



#include <QPointer>



class D20_MODELSHARED_EXPORT Skill : public Item
{
    class Data : public QSharedData
    {
    public:
        Data() : class_skill(false) {}
        Data(const Data& other) : QSharedData(other), attribute(other.attribute), class_skill(other.class_skill) {}

        QString campaign;
        QString attribute;

        bool class_skill;
    };

    Q_OBJECT


public:

    Skill(QObject* parent = 0);
    Skill(const Skill& other);

    int rank() const;
    bool isClassSkill() const;

    QString campaign() const;
    QString attribute() const;

    void setRank(const int& rank);
    void setClassSkill(const bool& yes);

    void setCampaign(const QString& campaign);
    void setAttribute(const QString& attribute);



    virtual QVariant bonus();


    virtual QDomElement toXmlElem(QDomElement& elem);
    virtual void fromXmlElem(QDomElement& elem);

private:

    QSharedDataPointer<Data> data;


};




#endif // SKILL_H


